]> dgit.raspbian.org Git - gnome-shell.git/commit
st/theme-node: Forget properties cache on stylesheet change
authorDaniel van Vugt <daniel.van.vugt@canonical.com>
Thu, 28 Mar 2024 06:45:26 +0000 (14:45 +0800)
committerSimon McVittie <smcv@debian.org>
Sun, 13 Jul 2025 11:24:58 +0000 (12:24 +0100)
commitb863e95b6cb2ba953dc50b2fda602d34742943d3
tree43a2532004a110c904a7a53efd1c695038ad5fef
parent8ec453daa66e22b1f9dcaecb7e488bf3a6a95ad7
st/theme-node: Forget properties cache on stylesheet change

To avoid `node->properties` pointing to freed memory after each
`st_theme_unload_stylesheet`, flush the cache that is `node->properties`.
They will be reloaded as soon as they are required by `ensure_properties`.

And yes `node->stylesheets_changed_id` already existed, but was unused.

Why not just fix Croco? Croco does not use proper reference counting
everywhere it should, and retrofitting it would be difficult due to the
recursive nature of `CRDeclaration`.

Includes commit:
st/theme-node: Forget properties cache before unref'ing the theme
Which the properties point into.

Forwarded: https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3252
Bug: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7339
Bug-Ubuntu: https://bugs.launchpad.net/bugs/2069559
Bug-Dash-to-Dock: https://github.com/micheleg/dash-to-dock/issues/2179

Gbp-Pq: Name st-theme-node-Forget-properties-cache-on-stylesheet-chang.patch
src/st/st-theme-node-private.h
src/st/st-theme-node.c